package beyjava.model;


/**
 * @author BEYJAVA
 * model class Person which is subclass of Resource class and 
 * superclass of Employee and Consultant classes
 */
public class Person extends Resource {
 private Integer personID;
 private String personName;
 private String personGender;
 
/**
 * @param personID
 * @param personName
 * @param personGender
 * @param resourceType
 * constructor of person class
 */
public Person(Integer personID, String personName, String personGender,String resourceType) {
	super(resourceType,personID);
	this.personID = personID;
	this.personName = personName;
	this.personGender = personGender;
}
/**
 * @param personID
 */
public void setPersonID(Integer personID) {
	this.personID = personID;
}
/**
 * @return personID
 */
public Integer getPersonID() {
	return personID;
}
/**
 * @param personName
 */
public void setPersonName(String personName) {
	this.personName = personName;
}
/**
 * @return personName
 */
public String getPersonName() {
	return personName;
}
/**
 * @param personGender
 */
public void setPersonGender(String personGender) {
	this.personGender = personGender;
}
/**
 * @return personGender
 */
public String getPersonGender() {
	return personGender;
}
@Override
public int hashCode() {
	final int prime = 31;
	int result = 1;
	result = prime * result
			+ ((personGender == null) ? 0 : personGender.hashCode());
	result = prime * result + ((personID == null) ? 0 : personID.hashCode());
	result = prime * result
			+ ((personName == null) ? 0 : personName.hashCode());
	return result;
}
@Override
public boolean equals(Object obj) {
	if (this == obj)
		return true;
	if (!super.equals(obj))
		return false;
	if (getClass() != obj.getClass())
		return false;
	Person other = (Person) obj;
	if (personGender == null) {
		if (other.personGender != null)
			return false;
	} else if (!personGender.equals(other.personGender))
		return false;
	if (personID == null) {
		if (other.personID != null)
			return false;
	} else if (!personID.equals(other.personID))
		return false;
	if (personName == null) {
		if (other.personName != null)
			return false;
	} else if (!personName.equals(other.personName))
		return false;
	return true;
}
@Override
public String toString() {
	return "Person [personID=" + personID + ", personName=" + personName
			+ ", personGender=" + personGender + "]";
}
}
